package com.mes.service.tdd;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.mes.dao.tdd.DepartmentMapper;
import com.mes.entity.tdd.Department;
import com.mes.entity.tdd.tj.Tpage;
/**
 * 
* @ClassName: DepartmentServiceImpl 
* @Description: 
* @Author tdd
* @Date 2017年11月27日 下午5:29:17 
* @version 1.0
 */
@Service
@Transactional
public class DepartmentServiceImpl implements DepartmentService{
	//注入部门Mapper
	@Resource DepartmentMapper departmentMapper;
	/**
	 * 分页查询
	 */
	@Override
	public List<Department> list(Tpage pageBean) {
		return departmentMapper.list(pageBean);
	}
	/**
	 * 查询
	 */
	@Override
	public List<Department> all(Tpage pageBean) {
		return departmentMapper.all(pageBean);
	}
	/**
	 * 分页条数
	 */
	@Override
	public int total(Tpage pageBean) {
		return departmentMapper.total(pageBean);
	}
	/**
	 * 添加
	 */
	@Override
	public Long add(Department department) {
		Long add = departmentMapper.add(department);
		return add;
	}
	/**
	 * 修改
	 */
	@Override
	public int updata(Department department) {
		return departmentMapper.edit(department);
	}
	/**
	 * 删除
	 */
	@Override
	public int updatadelete(Department department) {
		return departmentMapper.delete(department);
	}

}
